package com.door.erp.sevice.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.door.erp.dao.OrderItemtDao;
import com.door.erp.dao.base.GenericDao;
import com.door.erp.enums.BaseInfoStatus;
import com.door.erp.model.OrderItem;
import com.door.erp.pager.Pager;
import com.door.erp.sevice.OrderItemService;
import com.door.erp.sevice.base.GenericServiceImpl;


@Service(value="orderItemService")
public class OrderItemServiceImp extends GenericServiceImpl<OrderItem, Long> implements OrderItemService{

	@Resource(name="orderItemDao")
	private OrderItemtDao orderItemDao;

	@Override
	public List<OrderItem> getValidateResultSet(Map<String, Object> param,
			Pager pager) {
		Map<String , Object> m = new HashMap<String,Object>();
		m.put("status", BaseInfoStatus.NORMAL);
		if(param!=null){
			m.putAll(param);
		}
		return this.getAll(m, pager);
	}

	@Override
	public int getValidateResultSetCount(Map<String, Object> param) {
		Map<String , Object> m = new HashMap<String,Object>();
		m.put("status", BaseInfoStatus.NORMAL);
		if(param!=null){
			m.putAll(param);
		}
		return this.getCount(m);
	}

	@Override
	public GenericDao<OrderItem, Long> getDao() {
		// TODO Auto-generated method stub
		return orderItemDao;
	}

	@Override
	public List<OrderItem> getValidateResultSet(Map<String, Object> param) {
		// TODO Auto-generated method stub
		Map<String , Object> m = new HashMap<String,Object>();
		m.put("status", BaseInfoStatus.NORMAL);
		if(param!=null){
			m.putAll(param);
		}
		return this.getAll(m);
	}

	

	
}
